import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import quickStartRouter from './moudle/quickStart'
import baseComponentsRouter from './moudle/baseComponents'
import businessComponentsRouter from './moudle/businessComponents'
export const routes = [
  {
    path: '/',
    name: '首页',
    hidden: true, // 不显示在菜单
    redirect: '/quickStart'
  },
  // 路由表太长了,做了抽离
  quickStartRouter,
  baseComponentsRouter,
  businessComponentsRouter,
  // 测试路由仍在下方
  {
    path: '/test',
    name: '测试组件',
    component: { render: e => e('router-view') },
    hidden: /^true$/i.test(process.env.VUE_APP_TEST_HIDDENROUTER), // development环境下显示，线上环境屏蔽该模块
    children: [
      {
        path: 'kunkka-collapse-form',
        name: '面板表单组件',
        component: () => import('../views/kunkka-collapse-form/index.vue'),
        props: true
      },
      {
        path: 'kunkka-simple-table',
        name: '简单表格组件（simple）',
        component: () => import('../views/kunkka-simple-table/index.vue'),
        props: true
      },
      {
        path: 'kunkka-editable-table',
        name: '可编辑表格组件',
        component: () => import('../views/kunkka-editable-table/index.vue'),
        props: true
      },
      {
        path: 'kunkka-only-form-dialog',
        name: '简单Form弹窗（simple）',
        component: () => import('../views/kunkka-only-form-dialog/index.vue'),
        props: true
      },
      {
        path: 'kunkka-import-template',
        name: '导入模板组件',
        component: () => import('../views/kunkka-import-template/index.vue'),
        props: true
      },
      {
        path: 'visual-layout',
        name: '可视化布局',
        component: () => import('../views/visual-layout/index.vue'),
        props: true
      },
      {
        path: 'kunkka-table-transfer',
        name: '表格穿梭',
        component: () => import('../views/kunkka-table-transfer/index.vue'),
        props: true
      },
      {
        path: 'kunkka-tree-transfer',
        name: '树穿梭',
        component: () => import('../views/kunkka-tree-transfer/index.vue'),
        props: true
      },
      {
        path: 'kunkka-tree-to-table',
        name: '树穿梭至表格',
        component: () => import('../views/kunkka-tree-to-table/index.vue'),
        props: true
      },
      {
        path: 'kunkka-tree',
        name: '树',
        component: () => import('../views/kunkka-tree/index.vue'),
        props: true
      },
      {
        path: 'symui-field-cell',
        name: '移动端表单',
        meta: {
          type: 'mobile'
        },
        component: () => import('../views/symui-field-cell/index.vue'),
        props: true
      },
      {
        path: 'kunkka-form-table-dialog',
        name: 'Form+table弹窗（simple）',
        component: () => import('../views/kunkka-form-table-dialog/index.vue'),
        props: true
      },
      {
        path: 'kunkka-formtable-popup',
        name: 'formtable弹窗',
        component: () => import('../views/kunkka-formtable-popup/index.vue'),
        props: true
      },
      {
        path: 'kunkka-multistage-table',
        name: '多级表格',
        component: () => import('../views/kunkka-multistage-table/index.vue'),
        props: true
      },
      {
        path: 'kunkka-tabs-list',
        name: '动态新增标签页',
        component: () => import('../views/kunkka-tabs-list/index.vue'),
        props: true
      },
      {
        path: 'kunkka-detail-list',
        name: '首页明细抽屉',
        component: () => import('../views/kunkka-detail-list/index.vue'),
        props: true
      },
      {
        path: 'kunkka-panel-line',
        name: '面板连线',
        component: () => import('../views/kunkka-panel-line/index.vue'),
        props: true
      },
      {
        path: 'test',
        name: '测试',
        component: () => import('../views/test/index.vue'),
        props: true
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
